package org.infodavid.common.services;

import java.io.Serializable;
import java.util.Locale;
import java.util.Map;

import org.infodavid.common.model.IApplicationSettings;
import org.infodavid.common.model.IUser;
import org.infodavid.common.model.IUserSession;
import org.joda.time.DateTimeZone;

/**
 * The Interface IApplicationContext.
 */
public interface IApplicationContext {

  /** The constant LOCAL_BEAN_JNDI_NAME. */
  String LOCAL_BEAN_JNDI_NAME = "IApplicationContext/local";

  /** The client IP address property. */
  String IP_ADDRESS_PROPERTY = "org.infodavid.common.client.ip";

  /**
   * Gets the user.
   * @return the user
   */
  IUser getUser();

  /**
   * Gets the user session.
   * @return the user session
   */
  IUserSession getUserSession();

  /**
   * Gets the time zone.
   * @return the time zone
   */
  DateTimeZone getTimeZone();

  /**
   * Gets the locale.
   * @return the locale
   */
  Locale getLocale();

  /**
   * Gets the properties.
   * @return the properties
   */
  Map<String,Serializable> getProperties();

  /**
   * Gets the settings.
   * @return the settings
   */
  IApplicationSettings getSettings();

  /**
   * Sets the settings.
   * @param value the new settings
   */
  void setSettings(IApplicationSettings value);

  /**
   * Gets the persistence session.
   * @return the persistence session
   */
  Object getPersistenceSession();

  /**
   * Clean up the context. Close the session and remove all data.
   */
  void clear();
}
